/******************************************************
 *                                                     
 *              Score System               
 *                                                     
 *******************************************************/

/**
 * LogoutServlet.java
 *
 * 网页的响应Servlet
 *
 * @author sundy
 * @version 0.0.1
 * lastModified 2011-01-01
 */

package com.sundy.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sundy.core.Context;

public class LogoutServlet extends AbstractServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8251511384043038562L;

	public LogoutServlet() {
	}

	protected void doGet(Context context, HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doPost(context, request, response);
	}

	protected void doPost(Context context, HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		context.logout();
		response.sendRedirect(request.getContextPath());
	}
}
